﻿using AForge.Video.DirectShow;
using GalaSoft.MvvmLight;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WebcamMicLoudspeakerConnectVs2019.Model
{
    public class MainModel : ObservableObject
    {
        private FilterInfoCollection _videoDevices;
        public FilterInfoCollection VideoDevices
        {
            get { return _videoDevices; }
            set 
            { 
                _videoDevices = value;
                RaisePropertyChanged(()=> VideoDevices);
            }
        }

        private ObservableCollection<WebcamDevice> _videoDevicesItems = new ObservableCollection<WebcamDevice>();
        public ObservableCollection<WebcamDevice> VideoDevicesItems
        {
            get { return _videoDevicesItems; }
            set 
            { 
                _videoDevicesItems = value;
                RaisePropertyChanged(()=> VideoDevicesItems);
            }
        }

        private int _videoDevicesSelectedIndex;
        public int VideoDevicesSelectedIndex
        {
            get { return _videoDevicesSelectedIndex; }
            set
            {
                _videoDevicesSelectedIndex = value;
                RaisePropertyChanged(() => VideoDevicesSelectedIndex);
            }
        }

        private WebcamDevice _videoDevicesSelectedItem;
        public WebcamDevice VideoDevicesSelectedItem
        {
            get { return _videoDevicesSelectedItem; }
            set 
            { 
                _videoDevicesSelectedItem = value;
                RaisePropertyChanged(()=> VideoDevicesSelectedItem);
            }
        }




        private string _videoDeviceName;
        public string VideoDeviceName
        {
            get { return _videoDeviceName; ; }
            set 
            { 
                _videoDeviceName = value;
                RaisePropertyChanged(()=> VideoDeviceName);
            }
        }


        private bool _isVideo;
        public bool IsVideo
        {
            get { return _isVideo; }
            set 
            { 
                _isVideo = value;
                RaisePropertyChanged(()=> IsVideo);
            }
        }

        private string _test;
        public string Test
        {
            get { return _test; }
            set 
            { 
                _test = value;
                RaisePropertyChanged(()=> Test);
            }
        }

        public string Test1;

    }

    public class WebcamDevice: ObservableObject
    {
        private int _id;
        public int Id
        {
            get { return _id; }
            set 
            { 
                _id = value;
                RaisePropertyChanged(()=> Id);
            }
        }


        private string _name;
        public string Name
        {
            get { return _name; }
            set
            {
                _name = value;
                RaisePropertyChanged(() => Name);
            }
        }

    }


}
